// import React from "react";
import { Routes, Route, Navigate, NavLink } from "react-router-dom"
import { lazy, Suspense } from "react"
import Loading from "./pages/loading/Loading"
const Home = lazy(() => import("./pages/home/Home"))
const User = lazy(() => import("@/pages/User"))
export default function App() {
  return (
    <div className="App">
      <NavLink to="/home">Home</NavLink>
      <NavLink to="/user">User</NavLink>
      <Suspense fallback={<Loading>loading...</Loading>}>
        <Routes>
          <Route path="/home" element={<Home />} />
          <Route path="/user" element={<User />} />
          <Route path="/" element={<Navigate to={"/home"} />} />
        </Routes>
      </Suspense >
    </div>
  )
}